$ sox foo.wav -r 8000 foo.gsm resample -ql
However, sometimes this does with the following error:
sox: Input and Output rates must be different to use resample effect
I have seen people panicking about this, but it's just because the source files have been recorded at 8KHz, which is the same as the resample rate specified in the sox command. Sox is just saying 'I can't apply my resampling algo, because the output rate is the same as the input rate".
This is eaily overcome just by removing the resample statement on the end:
$ sox foo.wav -r 8000 foo.gsm
That's it. Now you're ready to go..
christo